﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using QLKS10_11.BLL;
using QLKS10_11.LOP_KHAC;

namespace QLKS10_11.GUI
{
    public partial class form_DN_taikhoan : Form
    {
        public form_DN_taikhoan()
        {
            InitializeComponent();
        }


        public static form_DN_taikhoan Instance()
        {
            if (_instance == null)
            {
                _instance = new form_DN_taikhoan();
            }
            return _instance;
        }
        private static form_DN_taikhoan _instance;



        /******************************************************XU LY DANG NHAP***********************************************************************************/
        DN_taikhoan_BLL dntk_ct = new DN_taikhoan_BLL();

        private void btn_dangnhap_Click(object sender, EventArgs e)
        {
            if (dntk_ct.kiemtra(txt_tendangnhap, txt_matkhau))
            {
                //dem = 0;
                MessageBox.Show("Đăng nhập thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //tv.GhiThongTinDangNhap(null, null, null, null, null);
            }
            else
            {
                //dem++;
                MessageBox.Show("Tên đăng nhập hoặc mật khẩu không đúng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private void tn_huy_Click(object sender, EventArgs e)
        {
            txt_tendangnhap.Clear();
            txt_matkhau.Clear();
        }

        private void form_DN_taikhoan_Load(object sender, EventArgs e)
        {
            btn_dangnhap.Focus();
        }
        
    }
}
